/**
 *获取初始化构造常用类型数据
 */
var initdata = new HashMap();
initdata.put('groupid', '88888888888888888888888888888888');
initdata.put('name', '四川省河北商会');
initdata.put('groupinfo', 11111);
initdata.put('dyncinfo', 22222);
initdata.put('informinfo', 33333);
initdata.put('gcotactsinfo', 44444);
initdata.put('mycotactsinfo', 55555);
initdata.put('busessinfo', 66666);
initdata.put('ecinfo', 77777);
initdata.put('showmeinfo', 88888);
initdata.put('yunzo', 99999);
initdata.put('yunzofindgroup', 99998);
initdata.put('yunzofindbusess', 99997);
initdata.put('yunzofindecinfo', 99996);
initdata.put('myinfo', 100000);
initdata.put('mymessage', 100001);
initdata.put('mycompany', 100002);
initdata.put('mygroupinfo', 100003);
initdata.put('myorder', 100004);
initdata.put('mybusess', 100005);
initdata.put('mycorne', 100006);
initdata.put('mycollter', 100007);
initdata.put('mysetinfo', 100008);
initdata.put('adinfo', 100009);
initdata.put('myinbox', 100010);
//默认手机号码
initdata.put('mid', '13500000000');
window.sysgroupid='88888888888888888888888888888888';
//当前用户手机号码
var $mid = window.localStorage.getItem("userNumber");
//当前团体ID
var $groupid=window.localStorage.getItem(window.localStorage.getItem("yunzokey")+"_"+"currentGroupid");
//当前团体name
var $groupname=window.localStorage.getItem(window.localStorage.getItem("yunzokey")+"_"+"currentGroupName");
var $grouplogo=window.localStorage.getItem(window.localStorage.getItem("yunzokey")+"_"+"logoUrl");

//当前用户名
var $myname= window.localStorage.getItem("userName");
//当前用户头像
var $myheadimg= window.localStorage.getItem("userUrl");
//当前用户性别
var $mysex= window.localStorage.getItem("userSex");
//当前用户籍贯
var $mynative= window.localStorage.getItem("userNative");
//当前用户生日
var $mybirthday=window.localStorage.getItem("userBirthday");
//当前团体职务
var $groupJob=window.localStorage.getItem(window.localStorage.getItem("yunzokey")+"_"+"groupJob");
//当前帐户浏览类型
var $mtype=window.localStorage.getItem("looktype");

var $mids=window.localStorage.getItem("yunzodfuserNumber");
var $groupidss=window.localStorage.getItem("yunzodfgroupid");
var u = navigator.userAgent, app = navigator.appVersion;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //android终端或者uc浏览器
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端

/**
*重写JS alert
*/
if(isiOS)
{
	window.alert = function(name){
				 var iframe = document.createElement("IFRAME");
				iframe.style.display="none";
				iframe.setAttribute("src", 'data:text/plain,');
				document.documentElement.appendChild(iframe);
				window.frames[0].window.alert(name);
				iframe.parentNode.removeChild(iframe);
		}
}
/**
*打电话
*/		
function phone(tel){
window.location.href = 'tel://' + tel;
}
/**
 * url参数取值方法
 * @param name
 * @returns
 */
function getUrlParam(name) {
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
	var r = decodeURIComponent(window.location.search.substr(1)).match(reg);
	if (r != null) return unescape(r[2]); return null;
}

/**
 *页面跳转时的基本参数
 *didtype 
 */
function basedata(didtype){	
	baseData="mid="+$mid+"&groupid="+$groupid+"&did="+initdata.get(didtype);
	return baseData;
}

/**
 *ajax 不带中文参数形式
 */
function ajaxcocRequest(url, method, bodyParam, callBack) {
	//var appKey = getCocAppKey();
	$.ajax({
	    url : url,
	    type : 'post',
	    data : bodyParam,
	    success:function(msg){
	    	 callBack(msg);
	    	}
	    });
}
/**
 * ajax  ch
 * @param url
 * @param method
 * @param bodyParam
 * @param callBack
 * bodyParam={"groupid":$groupid,"mid":$mid,"pagesize":pagesize,"did":66666,"type":0,"curcount":curCount,"likevalue":likevalue};
 */
function ajaxCoCRequest(url, method, bodyParam, callBack) {
	$.ajax({
	    url : url,
	    contentType: "application/json;charset=utf-8",
	    type : method,
	    dataType:'json',
	    data : JSON.stringify(bodyParam),
	    success:function(msg){
	    	 callBack(msg);
	    	}
	    });
}
/**
 * 头部标签 返回上级页面
 * @param url 页面地址
 */
function goback(url)
{
	$("#back").attr("href",url);
}
/**
 * 打开页面 不带参数
 * @param url 页面地址
 */
function openpage(url)
{
	window.location =url;
}
/**
 * 打开页面 带参数
 * @param url 页面地址
 * @param param 传递参数
 */
function openpageparam(url,param)
{
	window.location =url+"?"+param;
}

//手机号验证
function _checkPhone(phone) {
	var res = !!phone.match(/^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/);
	return res;
}
// 判断是否是正整数
function _isNumber(str) {
	var re = /^[0-9]*[1-9][0-9]*$/;
	return re.test(str);
}

// 是否是正浮点数
function _isDecimal(str) {
	var re = /^(([0-9]|([1-9][0-9]{0,9}))((\.[0-9]{1,2})?))$/;
	return re.test(str);
}

// 是否是日期格式
function _isDate(str) {
	var re = /^(?:(?:1[6-9]|[2-9][0-9])[0-9]{2}([-/.]?)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:(?:1[6-9]|[2-9][0-9])(?:0[48]|[2468][048]|[13579][26])|(?:16|[2468][048]|[3579][26])00)([-/.]?)0?2\2(?:29))(\s+([01][0-9]:|2[0-3]:)?[0-5][0-9]:[0-5][0-9])?$/;
	return re.test(str);
}

// 继承拓展对象
function _extents(obj1, obj2) {
	for (var i in obj2) {
		if (obj1[i]) {
			continue;
		} else {
			obj1[i] = obj2[i];
		}
	}
}

/**
 *生成访问接口使用的KEY值
 */
function getCocAppKey() {
	var appId = 'A6992522920616';
	var key = 'C41D7422-D83C-60B8-1689-6D9A1FA4D8F8';
	var now = Date.now();
	var nowtime = new Date();
	var appkey = SHA1((nowtime.getMonth() + 1) + appId + nowtime.getDate() + "YUNZO" + nowtime.getHours() + key + "YUNZO" + nowtime.getMinutes()) + "." + now + "." + (nowtime.getMonth() + 1) + "." + nowtime.getDate() + "." + nowtime.getHours() + "." + nowtime.getMinutes();
	return appkey;
}

/**
 *
 *  Secure Hash Algorithm (SHA1)
 *  http://www.webtoolkit.info/
 *
 **/
function SHA1(msg) {

	function rotate_left(n, s) {
		var t4 = (n << s ) | (n >>> (32 - s));
		return t4;
	};

	function lsb_hex(val) {
		var str = "";
		var i;
		var vh;
		var vl;

		for ( i = 0; i <= 6; i += 2) {
			vh = (val >>> (i * 4 + 4)) & 0x0f;
			vl = (val >>> (i * 4)) & 0x0f;
			str += vh.toString(16) + vl.toString(16);
		}
		return str;
	};

	function cvt_hex(val) {
		var str = "";
		var i;
		var v;

		for ( i = 7; i >= 0; i--) {
			v = (val >>> (i * 4)) & 0x0f;
			str += v.toString(16);
		}
		return str;
	};

	function Utf8Encode(string) {
		string = string.replace(/\r\n/g, "\n");
		var utftext = "";

		for (var n = 0; n < string.length; n++) {

			var c = string.charCodeAt(n);

			if (c < 128) {
				utftext += String.fromCharCode(c);
			} else if ((c > 127) && (c < 2048)) {
				utftext += String.fromCharCode((c >> 6) | 192);
				utftext += String.fromCharCode((c & 63) | 128);
			} else {
				utftext += String.fromCharCode((c >> 12) | 224);
				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
				utftext += String.fromCharCode((c & 63) | 128);
			}

		}

		return utftext;
	};

	var blockstart;
	var i, j;
	var W = new Array(80);
	var H0 = 0x67452301;
	var H1 = 0xEFCDAB89;
	var H2 = 0x98BADCFE;
	var H3 = 0x10325476;
	var H4 = 0xC3D2E1F0;
	var A, B, C, D, E;
	var temp;

	msg = Utf8Encode(msg);

	var msg_len = msg.length;

	var word_array = new Array();
	for ( i = 0; i < msg_len - 3; i += 4) {
		j = msg.charCodeAt(i) << 24 | msg.charCodeAt(i + 1) << 16 | msg.charCodeAt(i + 2) << 8 | msg.charCodeAt(i + 3);
		word_array.push(j);
	}

	switch (msg_len % 4) {
		case 0:
			i = 0x080000000;
			break;
		case 1:
			i = msg.charCodeAt(msg_len - 1) << 24 | 0x0800000;
			break;

		case 2:
			i = msg.charCodeAt(msg_len - 2) << 24 | msg.charCodeAt(msg_len - 1) << 16 | 0x08000;
			break;

		case 3:
			i = msg.charCodeAt(msg_len - 3) << 24 | msg.charCodeAt(msg_len - 2) << 16 | msg.charCodeAt(msg_len - 1) << 8 | 0x80;
			break;
	}

	word_array.push(i);

	while ((word_array.length % 16) != 14)
	word_array.push(0);

	word_array.push(msg_len >>> 29);
	word_array.push((msg_len << 3) & 0x0ffffffff);

	for ( blockstart = 0; blockstart < word_array.length; blockstart += 16) {

		for ( i = 0; i < 16; i++)
			W[i] = word_array[blockstart + i];
		for ( i = 16; i <= 79; i++)
			W[i] = rotate_left(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);

		A = H0;
		B = H1;
		C = H2;
		D = H3;
		E = H4;

		for ( i = 0; i <= 19; i++) {
			temp = (rotate_left(A, 5) + ((B & C) | (~B & D)) + E + W[i] + 0x5A827999) & 0x0ffffffff;
			E = D;
			D = C;
			C = rotate_left(B, 30);
			B = A;
			A = temp;
		}

		for ( i = 20; i <= 39; i++) {
			temp = (rotate_left(A, 5) + (B ^ C ^ D) + E + W[i] + 0x6ED9EBA1) & 0x0ffffffff;
			E = D;
			D = C;
			C = rotate_left(B, 30);
			B = A;
			A = temp;
		}

		for ( i = 40; i <= 59; i++) {
			temp = (rotate_left(A, 5) + ((B & C) | (B & D) | (C & D)) + E + W[i] + 0x8F1BBCDC) & 0x0ffffffff;
			E = D;
			D = C;
			C = rotate_left(B, 30);
			B = A;
			A = temp;
		}

		for ( i = 60; i <= 79; i++) {
			temp = (rotate_left(A, 5) + (B ^ C ^ D) + E + W[i] + 0xCA62C1D6) & 0x0ffffffff;
			E = D;
			D = C;
			C = rotate_left(B, 30);
			B = A;
			A = temp;
		}

		H0 = (H0 + A) & 0x0ffffffff;
		H1 = (H1 + B) & 0x0ffffffff;
		H2 = (H2 + C) & 0x0ffffffff;
		H3 = (H3 + D) & 0x0ffffffff;
		H4 = (H4 + E) & 0x0ffffffff;

	}

	var temp = cvt_hex(H0) + cvt_hex(H1) + cvt_hex(H2) + cvt_hex(H3) + cvt_hex(H4);

	return temp.toLowerCase();

}

function HashMap() {
	/**Map大小**/
	var size = 0;
	/**对象**/
	var entry = new Object();
	/**Map的存put方法**/
	this.put = function(key, value) {
		if (!this.containsKey(key)) {
			size++;
			entry[key] = value;
		}
	};
	/**Map取get方法**/
	this.get = function(key) {
		return this.containsKey(key) ? entry[key] : null;
	};
	/**Map删除remove方法**/
	this.remove = function(key) {
		if (this.containsKey(key) && (
		delete entry[key] )) {
			size--;
		}
	};
	/**是否包含Key**/
	this.containsKey = function(key) {
		return ( key in entry);
	};
	/**是否包含Value**/
	this.containsValue = function(value) {
		for (var prop in entry) {
			if (entry[prop] == value) {
				return true;
			}
		}
		return false;
	};
	/**所有的Value**/
	this.values = function() {
		var values = new Array();
		for (var prop in entry) {
			values.push(entry[prop]);
		}
		return values;
	};
	/**所有的 Key**/
	this.keys = function() {
		var keys = new Array();
		for (var prop in entry) {
			keys.push(prop);
		}
		return keys;
	};
	/**Map size**/
	this.size = function() {
		return size;
	};
	/**清空Map**/
	this.clear = function() {
		size = 0;
		entry = new Object();
	};
}
function openNewWindow(url){
	window.location=url+".html"+"?mid="+$mid+"&groupid="+$groupid;
}
function openSetNewWindow(url){
	window.location=url+'.html';
}

//function goback(){
//    window.location="mine.html";
//}
//AJAX加载开始----加载结束
function sTart_Stop(){
	$(document).ajaxStart(function(){
		$(".div_loding_img").css("display","block");
	});
	$(document).ajaxStop(function(){
		$(".div_loding_img").css("display","none");
		
	});
}
function refresh_failure(){
	$("#loadIng_startStop").hide();
    $("#tanChu1").show();
    $("#tanChu_btn1").click(function(){
        $("#tanChu1").hide();
    });
}
var arr_industry=['电力行业','船舶制造','商业百货','农林牧渔','仓储物流','旅游酒店','钢铁行业','金融投资','机械机电','教育培训','交通运输','纺织服装','传媒娱乐','生物制药','物资外贸','医疗器械','高新技术','石油化工','建筑建材','房地产业','电器家电','供水供气','公路桥梁','农药化肥','印刷包装','食品行业','电子信息','矿产冶金','水泥行业','电子器件','社会服务','轻工化纤','汽车汽配','家具行业','其他'];
var arr_industry1=['0d90bd77-06a1-463d-9bef-10e6c975','122dbf72-6c7e-46bf-aec2-efd02b08','18e895ac-8620-4642-9555-767d8c0b','1aabeed3-2955-4288-912d-8380a419','1c8ad138-01a9-4858-a414-d017b937','226cdfae-7fa5-4928-b689-85e3d004','24bcd349-7954-4ca2-a9a8-c187f468','317d6a95-b163-402a-85e0-9adb67be','3c3f309b-71ef-448e-ab31-81d6ab7c','3c413b01-4092-450f-80b1-edaeb641','416bda5b-20a0-4b32-95fd-8c5b21f1','45a32a5d-c4c6-4f4a-9def-d445eb00','47436cd6-938c-44e7-ade1-09b555a8','4fa2b370-1f6a-4094-a113-40a93639','519a0271-e291-4fab-8624-9f2a545b','54203358-adf0-42de-9fa8-8f2b9389','56817bb3-b342-44d7-81ae-671b64ae','6284a9f2-d16b-4b9e-949c-12a38d67','6c007314-153b-4643-81d6-36b1a319','7be63598-1706-45f0-acc0-127e64ad','7f511a6b-7568-462e-915d-29670647','8ab624b5-b283-4dc5-acc6-1100e09c','99bb5da8-a888-4fd2-97e5-ea524ec7','a820e0de-79d3-4b9e-9154-e19a70c6','b11f8b53-d7d3-41b5-a690-06fc4a0c','bb5129b0-755f-4fd4-9803-1c03da5e','cea735f2-54a5-4b30-aa91-71497c31','d1993429-ecd8-4189-a30a-4f2476d7','d340a649-c14e-4fc2-bdbe-a9a716e1','d5a6bef0-e9bb-4a93-860e-94c84c8f','d9a97c1f-d26b-48b1-a95a-61915067','da9c1409-5dc2-45fb-8941-fbabbc1e','df5ffe14-e141-4d87-b123-5f1b747e','e95f065d-2310-4554-94d7-a95be3a6','f24ecdb1-6b30-4db6-9e2a-ea2ccad2'];
var arr_comproperty=['国有企业','合作企业','合资企业','独资企业','集体企业','私营企业','个体工商','报关','其他'];
var arr_comscale=['0-50人','50-100人','100-500人','500-1000人','1000人以上'];
var arr_comduty=['董事长','总经理','副总经理','部门经理','员工'];

function back_go(){
	window.history.back();
}

